package com.sc.nft.admin.controller;



import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.dto.IdRequest;
import com.sc.nft.entity.dto.SaasTaskAwardDetailsListDTO;
import com.sc.nft.entity.dto.SaasTaskAwardPackDTO;
import com.sc.nft.entity.dto.SaasTaskAwardPackStageDTO;
import com.sc.nft.entity.dto.SaasTaskStageConfigurationListVO;
import com.sc.nft.entity.vo.SaasTaskAwardDetailsListVO;
import com.sc.nft.service.SaasTaskAwardDetailsService;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * 任务奖励表(SaasTaskAwardDetails)表控制层
 *
 * @author 王伟成
 * @since 2024-01-03 18:05:14
 */

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/saasTaskAwardDetails/")
@Api(tags = "任务奖励配置")
public class SaasTaskAwardDetailsController {
    /**
     * 服务对象
     */
    private final SaasTaskAwardDetailsService saasTaskAwardDetailsService;





    @PostMapping(value = "modification", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "新增/修改奖励", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result modification(@Valid @RequestBody SaasTaskAwardPackStageDTO saasTaskAwardPackStageDTO) {
        saasTaskAwardDetailsService.modificationAward(saasTaskAwardPackStageDTO);
        return Result.success();
    }

    @PostMapping(value = "list", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "获取奖励列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<SaasTaskAwardDetailsListVO> list(@Valid @RequestBody SaasTaskAwardDetailsListDTO saasTaskAwardDetailsListDTO) {
        return Result.success(saasTaskAwardDetailsService.list(saasTaskAwardDetailsListDTO));
    }

}
